//路由规则
const routes = [
    {
        path: '/Index',
        name: "Index",
        component: () => import('../views/Index.vue'),
        children: [//二级路由
            {
                path: '/Index/Home',
                name:'Home',
                meta:{title:"首页"},   //路由元信息，必须是对象的形式
                component: () => import('../views/Index/Home.vue')
            },
            {
                path: '/Index/BBT',
                name:'BBT',
                meta:{title:"爆爆团"}, 
                component: () => import('../views/Index/BaoBaoTuan.vue')
            },
            {
                path: '/Index/Order',
                name:'Order',
                meta:{title:"订单"}, 
                component: () => import('../views/Index/Order.vue')
            },
            {
                path: '/Index/My',
                name:'My',
                meta:{title:"我的"}, 
                component: () => import('../views/Index/My.vue')
            },
            {
                path: '/Index',
                redirect: '/Index/Home'//重定向
            },
            //404路由
            {
                path: '*',
                component: () => import('../views/NotFound.vue')
            }
        ]
    },
    {
        path: '/Sort',
        name:'Sort',
        component: () => import('../views/Sort.vue')
    },
    {
        path: '/Login',
        name:'Login',
        component: () => import('../views/Login.vue')
    },
    {
        path: '/Register',
        name:'Register',
        component: () => import('../views/register.vue')
    },
    {
        path: '/Ser',
        name:'Ser',
        component: () => import('../views/Search/search.vue'),
        /* children: [//二级路由
            {
                path:'/Ser/SearchSouSuo',
                name:'SearchSouSuo',
                meta:{title:"搜索"},
                component:() => import('../views/Search/searchsousuo.vue')
            },
            {
                path:'/Ser/SearchShop',
                name:'SearchShop',
                meta:{title:"搜索详情"},
                component:() => import('../views/Search/searchshop.vue')
            },
            {
                path: '/Ser',
                redirect: '/Ser/SearchSouSuo'//重定向
            },
            //404路由
            {
                path: '*',
                component: () => import('../views/NotFound.vue')
            }
        ] */
    },
    {
        path:'/Ser/SearchSouSuo',
        name:'SearchSouSuo',
        component:() => import('../views/Search/searchsousuo.vue')
    },
    {
        path:'/Ser/SearchShop',
        name:'SearchShop',
        component:() => import('../views/Search/searchshop.vue')
    },
    {
        path: '/MyAddress',
        name:'MyAddress',
        component: () => import('../views/My/MyAddress.vue')
    },
    {
        path: '/NewAddress',
        name:'NewAddress',
        component: () => import('../views/My/NewAddress.vue')
    },
    {
        path: '/changeAddress',
        name:'changeAddress',
        component: () => import('../views/My/changeAddress.vue')
    },
    {
        path: '/ShopCollect',
        name:'ShopCollect',
        component: () => import('../views/My/ShopCollect.vue')
    },
    {
        path: '/',
        redirect: '/Index'//重定向
    },
    //404路由
    {
        path: '*',
        component: () => import('../views/NotFound.vue')
    }
]

export default routes